package com.qiancheng.service.impl;

import com.qiancheng.mapper.UsersMapper;
import com.qiancheng.pojo.Users;
import com.qiancheng.service.IUserService;
import org.n3r.idworker.Sid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private UsersMapper usersMapper;

    @Autowired
    private Sid sid;



//    用户注册
    @Override
    public int resister(Users user) {
        user.setId(sid.nextShort());
        return usersMapper.insert(user);
    }
}
